﻿using Castle.DynamicProxy;
using Castle.MicroKernel.Registration;
using Castle.Windsor;

namespace Gaia.Alp.Dependency.Castle.Configuration {
	/// <summary>
	/// 	This class contains the Windsor configuration
	/// </summary>
	internal static class CastleConfiguration  {
		public static void RegisterInterceptor ( IWindsorContainer container ) {
			container.Register (
				AllTypes.FromAssembly ( typeof ( CastleConfiguration ).Assembly )
					.BasedOn <IInterceptor> ( )
					.Configure ( reg => reg.LifeStyle.Singleton.Named ( reg.Implementation.Name ) )
					.WithService.FromInterface ( ) );
		}
	}
}